/**
 * 
 */
package at.fhooe.mcm12.java.GUIElements;

import java.awt.TextArea;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTextArea;

/**
 * @author Lisi
 * 
 */
public class TextPanel extends JPanel {

	private String m_title;
	private JTextArea m_textArea;

	/**
	 * Constructor
	 * @param _title Panel Title
	 * @param _text inside textarea
	 */
	public TextPanel(String _title, String _text) {
		m_title = _title;

		// init GUI
		m_textArea = new JTextArea(_text);
		this.add(m_textArea);
		this.setBorder(BorderFactory.createTitledBorder(m_title));
	}

	/**
	 * @return the m_title
	 */
	public String getTitle() {
		return m_title;
	}

	/**
	 * @param m_title
	 *            the m_title to set
	 */
	public void setTitle(String _title) {
		this.m_title = _title;
		this.setBorder(BorderFactory.createTitledBorder(m_title));
	}

	/**
	 * @return the m_textArea
	 */
	public JTextArea getTextArea() {
		return m_textArea;
	}

	/**
	 * @param m_textArea
	 *            the m_textArea to set
	 */
	public void setTextArea(JTextArea _textArea) {
		this.m_textArea = _textArea;
	}

}
